import numpy as np
from scipy.optimize import root,fsolve


# 使用scipy.optimize模块的 fsolve 函数进行数值求解方程
# 求解f(x)=2*sin(x)-x+1

def f1(x):
    return np.sin(x)*2-x+1



value = fsolve(f1,[2])
print(value)



import matplotlib.pyplot as plt


sizes = [12, 23, 11, 17, 19, 24, 29, 11, 12, 9, 7, 5, 3, 2, 1]
labels = ["Market %s" % i for i in sizes]

fig1, ax1 = plt.subplots(figsize=(5, 5))
fig1.subplots_adjust(0.1, 0.1, 1, 1)

theme = plt.get_cmap('jet')
ax1.set_prop_cycle("color", [theme(1. * i / len(sizes))
                             for i in range(len(sizes))])

_, _ = ax1.pie(sizes, startangle=90, radius=1800, frame=True)

ax1.axis('equal')
plt.show()

